package com.smart.persistence.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

//*/# INICIO - EXERC. 6
@Entity
@Table(name = "T_Card")
@NamedQueries({
	@NamedQuery(name = Card.findByCardNumber, query = "SELECT  entity  FROM Card entity where entity.cardNumber = ?1 ")
})

//FIM - EXERC. 6 #*/
public class Card {
	
	///*/# INICIO - EXERC. 6
	public static final String findByCardNumber = "Card.findByCardNumber";
	

	@Id
	@Column(name = "id_card")
	@TableGenerator(name = "CARD_GEN", allocationSize = 1, initialValue = 1, table = "T_ID", pkColumnName = "key", 
			valueColumnName = "valor", pkColumnValue = "ID_CARD")
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "CARD_GEN")
	private Long id;
	
	private Long cardNumber;
	
	private String cardType;
	
	private Short expiryMonth;
	
	private Short expiryYear;
	
	private String firstName;
	
	private String lastName;
	
	private Short securityCode;

	
	public Long getCardNumber() {
		return cardNumber;
	}

	public void setCardNumber(Long cardNumber) {
		this.cardNumber = cardNumber;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public Short getExpiryMonth() {
		return expiryMonth;
	}

	public void setExpiryMonth(Short expiryMonth) {
		this.expiryMonth = expiryMonth;
	}

	public Short getExpiryYear() {
		return expiryYear;
	}

	public void setExpiryYear(Short expiryYear) {
		this.expiryYear = expiryYear;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Short getSecurityCode() {
		return securityCode;
	}

	public void setSecurityCode(Short securityCode) {
		this.securityCode = securityCode;
	}
	
	
	
	//FIM - EXERC. 6 #*/
}
